package logicaPresentacion;

import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.BorderLayout;
import java.util.Date;


public class Bienvenida extends JFrame implements Runnable
{
	/**
	 * 
	 */
	private static final long serialVersionUID = -7797631615387833992L;
	private JLabel etiqueta;

	
	public Bienvenida()
	{
		super("BUENOS DIAS");
		etiqueta = new JLabel();

		this.getContentPane().setLayout(new BorderLayout());
		this.getContentPane().add(etiqueta,"Center");
				
		this.setSize(320,100);
		this.setLocation(500,100);
		this.setVisible(true);
	}

	public void run() 
	{
		int i = 0;
		boolean a = true;
		
		etiqueta.setText("Fecha de la conexion:  \n " + new Date());
		
		while(a)
		{
			if (i < 5)
			{
				try {
					Thread.sleep(1000);
				} catch (InterruptedException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}

			i++;
			}
			else
			{
				a = false;
			}
		}
		dispose();
	}
}